# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=py3-telethon
pkgver=1.16.1
pkgrel=0
pkgdesc="Full-featured Telegram client library"
url="https://docs.telethon.dev/"
arch="noarch"
license="MIT"
depends="python3 py3-pyaes py3-rsa"
makedepends="py3-setuptools"
checkdepends="py3-pytest py3-pytest-asyncio"
source="https://github.com/LonamiWebs/Telethon/archive/v$pkgver/Telethon-v$pkgver.tar.gz"
builddir="$srcdir/Telethon-$pkgver"

build() {
	python3 setup.py sdist
}

check() {
	pytest
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"

	# Remove installed tests
	local _site_packages=$(python3 -c "import site; print(site.getsitepackages()[0])")
	rm -r "$pkgdir/$_site_packages"/tests/
}

sha512sums="11fced6b9de7209970403871a7fed8e3b553da20f1750abf62029b87128d8ccaea9de7fa57576f3eecae7d13ca2c647d07307d191a2ce54f128e573a38904e71  Telethon-v1.16.1.tar.gz"
